package com.qingke.pojo;

import java.beans.PropertyEditorSupport;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DatePropertyEdit extends PropertyEditorSupport {
	private String format="yy-MM-dd hh:mm:ss";
	@Override
	public void setAsText(String text) throws IllegalArgumentException {
		SimpleDateFormat sdf=new SimpleDateFormat(format);
		Date date=null;
		try {
			date=sdf.parse(text);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		setValue(date);
	}
	
}
